<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    // - 红色的大众车
    // - 白色的大众车
    // - 黑色的五菱车
    // - 蓝色的五菱车


    function Car(c, b){
        this.color = c;
        this.brand = b;
    }
    Car.prototype.run = function(){
        console.log(`${this.color}的${this.brand}车跑起来了`)
    }

    function DZCar(c){
        return new Car(c, "大众");
    }

    const c1 = new DZCar("红色");
    const c2 = new DZCar("白色");

    const c3 = new Car("黑色", "五菱");
    const c4 = new Car("蓝色", "五菱");
    console.log(c1);
    console.log(c2);
    console.log(c3);
    console.log(c4);
    
</script>
</html>